package com.example.gulimall.search.vo;

import com.example.common.to.es.SkuEsModel;
import com.sun.tracing.dtrace.ArgsAttributes;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
public class SearchResult {

    // 商品信息
    private List<SkuEsModel> products;

    // 分页信息
    private Integer pageNum;
    private Long total;
    private Integer totalPages;
    private List<Integer> pageNavs;

    private List<BrandVo> brands;
    private List<AttrVo> attrs;
    private List<CatalogVo> catalogs;

    private List<NavVo> navs = new ArrayList<>();
    private List<Long> attrIds = new ArrayList<>();

    @Data
    public static class NavVo{
        private String navName;
        private String navValue;
        private String link;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class CatalogVo{
        private Long catalogId;
        private String catalogName;

        @Override
        public String toString() {
            return "CatalogVo{" +
                    "catalogId=" + catalogId +
                    ", catalogName='" + catalogName + '\'' +
                    '}';
        }
    }


    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BrandVo{
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AttrVo{
        private Long attrId;
        private String attrName;
        private List<String> attrValue;

        @Override
        public String toString() {
            return "AttrVo{" +
                    "attrId=" + attrId +
                    ", attrName='" + attrName + '\'' +
                    ", attrValue=" + attrValue +
                    '}';
        }
    }


}
